package mx.tarhimurhu.amoxcalli;

import java.io.Serializable;

public class Author implements Serializable
{
	private String firstName;
	private String middleInitial;
	private String lastName;
	
	
	
	
	
	public Author()
	{
		firstName = "";
		middleInitial = "";
		lastName = "";
	}

	public Author(String firstName, String middleInitial, String lastName)
	{
		this.firstName = firstName;
		this.middleInitial = middleInitial;
		this.lastName = lastName;
	}
	
	
	
	
	
	/***********************************************************************************************
	 * 	
	 * Getters and Setters
	 * 
	 ***********************************************************************************************/
	public String getFirstName() {
		return firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getMiddleInitial() {
		return middleInitial;
	}

	public void setMiddleInitial(String middleInitial) {
		this.middleInitial = middleInitial;
	}

	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}
	
	
	
	/*
	 * In the future, instead of using too string, we should be using an interface called format
	 * and have various classes implement different formats.
	 */
	
	public String toString()
	{
		String s = lastName + ", " + firstName.substring(0,1) + ". ";
		
		if(!middleInitial.equals(""))
		{
			s += middleInitial + ".";
		}
		
		return s;
	}
	
	
}
